//
//  MenuViewController.m
//  LO_MUSIC
//
//  Created by 胡林 on 16/2/24.
//  Copyright © 2016年 杨少锋. All rights reserved.
//

#import "MenuViewController.h"
#import "AppDelegate.h"
#include "MuisicViewController.h"
#import "ReadViewController.h"
@interface MenuViewController ()



@end

@implementation MenuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //音乐BUTTON的设置
    UIButton * music = [UIButton buttonWithType:UIButtonTypeSystem];
    music.frame = CGRectMake(50, 200, 100, 50);
    [music setTitle:@"音乐" forState:(UIControlStateNormal)];

    [music addTarget:self action:@selector(musicAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:music];
    //阅读BUTTON的设置
    UIButton * read = [UIButton buttonWithType:UIButtonTypeSystem];
    read.frame = CGRectMake(50, 300, 100, 50);
    [read setTitle:@"阅读" forState:(UIControlStateNormal)];
    
    [read addTarget:self action:@selector(readAction) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:read];

    
    
}
//音乐
-(void)musicAction{
    MuisicViewController * music = [MuisicViewController new];
    UINavigationController * muisc_na = [[UINavigationController alloc]initWithRootViewController:music];
    AppDelegate * app = [UIApplication sharedApplication].delegate;
    [app.draw setRootViewController:muisc_na];
}
//阅读
-(void)readAction{
    ReadViewController * read = [ReadViewController new];
    AppDelegate * app = [UIApplication sharedApplication].delegate;
    UINavigationController * read_na = [[UINavigationController alloc] initWithRootViewController:read];
    
    [app.draw setRootViewController:read_na];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
